Imports system.Data.SqlClient

Public Class PlanesDeProduccion
    Public Function GenerarPP(ByVal Fec, ByVal Can, ByVal PEE, ByVal PEF, ByVal Obs)
        Dim DS As String
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "PlanDeProduccionGenerar", New SqlParameter("@Fec", Fec), _
        New SqlParameter("@Can", Can), New SqlParameter("@PEE", PEE), New SqlParameter("@PEF", PEF), _
        New SqlParameter("@Obs", Obs)).ToString
        Return DS
    End Function

    Public Function ModificarPP(ByVal CodPP, ByVal Fec, ByVal Can, ByVal PEE, ByVal PEF, ByVal Obs)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "PlanesDeProduccionModificar", New SqlParameter("@CodPP", CodPP), _
        New SqlParameter("@Fec", Fec), New SqlParameter("@Can", Can), New SqlParameter("@PEEPP", PEE), _
        New SqlParameter("@PEFPP", PEF), New SqlParameter("@Obs", Obs))
        Return DS
    End Function

    Public Function ObtenerPP(ByVal Estado As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, "PlanesDeProduccionObtener", Estado)
        Return DS
    End Function

    Public Function GenerarIPP(ByVal CodPP, ByVal Fec, ByVal PEEIPP, ByVal Obs)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, "ItemsDePPGenerar", CodPP, Fec, PEEIPP, Obs)
        Return DS
    End Function

    Public Function ObtenerIPP(ByVal Estado As String, ByVal CodPP As Integer)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, "ItemsDePPObtener", Estado, CodPP)
        Return DS
    End Function

    Public Function ModificarIPP(ByVal CodIPP, ByVal Est)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "ItemsDePPModificar", New SqlParameter("@CodIPP", CodIPP))
        Return DS
    End Function

    Public Function EliminarIPP(ByVal CodIPP)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "ItemsDePPEliminar", New SqlParameter("@CodIPP", CodIPP))
        Return DS
    End Function
End Class
